package eu.log.db;

import java.util.Hashtable;

import eu.log.ConfigGetter;
import eu.log.Storage;

public class StorageFactory {
	private static Hashtable<String,Storage> storageMap=new Hashtable<String,Storage>();
	public static Storage newStorage(String uri){
		String dir=ConfigGetter.getParameter("dataDirectory");
		if(dir==null)
			dir="log_default";
		String key=dir+"/"+uri;
		Storage storage=storageMap.get(key);
		if(storage!=null)
			return storage;
		storage=new StorageOverDataBase(dir,uri);
		storageMap.put(key, storage);
		return storage;
	}
}
